import http from '@/utils/http';

const lens = {
  //获取所有销售镜种
  getLenses() {
    let url = '/Lens/GetLenses';
    return http.get(url);
  },
  //获取此仓库可添加到库存的所有的镜种
  getCanAddStockLenses(params: any) {
    let url = '/Lens/GetCanAddStockLenses';
    return http.post(url, params);
  },
  //获取此仓库库存的所有的镜种
  getStockLenses(warehouseId: Number) {
    let url = '/Lens/GetStockLenses';
    let params = { warehouseId: warehouseId };
    return http.get(url, params);
  },
  //获取此供应商和仓库库存的所有的镜种
  getStockLensesBySupplierAndWarehouse(params: any) {
    let url = '/Lens/GetStockLenses';
    return http.post(url, params);
  },
  //销售镜种视图
  query(params: any) {
    let url = '/Lens/Query';
    return http.post(url, params);
  },
  //销售镜种详情
  detail(id: Number) {
    let url = '/Lens/Detail';
    let params = { id: id };
    return http.get(url, params);
  },
  //销售镜种保存
  save(role: Object) {
    let url = '/Lens/Save';
    return http.post(url, role);
  },
};
export default lens;
